﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using Function;

namespace UI.UserControl.Base
{
    /// <summary>
    /// 分页控件基类
    /// </summary>
    public class PagerBase : System.Web.UI.UserControl
    {
        public PagerBase()
        {
        }

        private int currentPageIndex = 1;

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPageIndex
        {
            get { return currentPageIndex; }
            set { currentPageIndex = value; }
        }

        private int pageSize = 10;

        /// <summary>
        /// 每页显示的记录条数
        /// </summary>
        public int PageSize
        {
            get { return pageSize; }
            set { pageSize = value; }
        }

        /// <summary>
        /// 记录条数
        /// </summary>
        public int RecordCount
        {
            get { return ViewState["RecordCount"].ToInt32(); }
            set { ViewState["RecordCount"] = value; }
        }

        /// <summary>
        /// 分页html内容
        /// </summary>
        protected string PagerHtml
        {
            get { return ViewState["PagerHtml"].ToString(); }
            set { ViewState["PagerHtml"] = value; }
        }
    }
}